package com.mirror.llk.view;

import java.util.ArrayList;
import java.util.HashMap;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mirror.llk.R;
import com.mirror.utils.adapter.CustomComplexAdapter;
import com.mirror.utils.view.CustomListView;

public class ThemeChooseView extends LinearLayout {

	private static final String TAG = "ThemeChooseView";

	private Context context;

	public CustomListView listView;

	public CustomComplexAdapter adapter;

	public Button btnDiy;

	public TextView tvDownload;

	public ThemeChooseView(Context context) {
		this(context, null);
	}

	@SuppressWarnings("deprecation")
	public ThemeChooseView(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;
		LayoutInflater.from(context).inflate(R.layout.theme_choose, this, true);
		setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
		this.init();
	}

	private void init() {
		listView = (CustomListView) this.findViewById(R.id.lv_themeChoose);
		adapter = new CustomComplexAdapter(context, new ArrayList<HashMap<String, Object>>(), R.layout.theme_choose_item, new String[] { "userNick",
		        "themeName", "themeImage" },
		        new int[] { R.id.tv_themeChoose_userNick, R.id.tv_themeChoose_themeName, R.id.iv_themeChoose_themePhoto });
		listView.setAdapter(adapter);

		btnDiy = (Button) this.findViewById(R.id.btnDiy);
		tvDownload = (TextView) this.findViewById(R.id.tv_themeList_download);
	}

}
